using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

//Importamos
using EventSys.BussinesEntities;

namespace EventSys.Repository.Mapping
{
    public class UbigeoMap : EntityTypeConfiguration<Ubigeo>
    {
        public UbigeoMap()
        {
            // Primary Key
            this.HasKey(t => t.idUbigeo);

            // Properties
            this.Property(t => t.idUbigeo)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.idPais)
                .HasMaxLength(50);

            this.Property(t => t.idDepartamento)
                .HasMaxLength(50);

            this.Property(t => t.idProvincia)
                .HasMaxLength(50);

            this.Property(t => t.idUbigeoR)
                .HasMaxLength(50);

            this.Property(t => t.Nombre)
                .HasMaxLength(50);

            this.Property(t => t.Nivel)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Ubigeo");
            this.Property(t => t.idUbigeo).HasColumnName("idUbigeo");
            this.Property(t => t.idPais).HasColumnName("idPais");
            this.Property(t => t.idDepartamento).HasColumnName("idDepartamento");
            this.Property(t => t.idProvincia).HasColumnName("idProvincia");
            this.Property(t => t.idUbigeoR).HasColumnName("idUbigeoR");
            this.Property(t => t.Nombre).HasColumnName("Nombre");
            this.Property(t => t.Nivel).HasColumnName("Nivel");
        }
    }
}
